/*
 * Copyright (C), 2002-2016, 苏宁易购电子商务有限公司
 * FileName: TaskA.java
 * Author:   15050536
 * Date:     2016年12月7日 下午4:55:47
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.suning.sawp.service.impl.tm;

import java.util.Map;
import java.util.concurrent.Callable;

import com.suning.sawp.intf.dao.tm.TimeMachineDao;
import com.suning.sawp.po.tm.EmployeeHireInfo;


/**
 * 查询员工入司信息 任务
 *
 * @author 15050536 石键平
 */
public class TaskA implements Callable<EmployeeHireInfo>{

	private TimeMachineDao timeMachineDao;
	
	private String employeeId;
	
	
	
	public TaskA(TimeMachineDao timeMachineDao,String employeeId){
		this.timeMachineDao	= timeMachineDao;
		this.employeeId = employeeId;
	}
	
	@Override
	public EmployeeHireInfo call() throws Exception {
		EmployeeHireInfo hireInfo = timeMachineDao.findEmployeeHireByEmployeeId(employeeId);
		if(hireInfo == null){
			return null;
		}
		
		//查询是否领取过券
		Map<String,Object> map = timeMachineDao.findReceiveCouponByEmployeeId(employeeId);
		if(map != null && map.size() > 0){
			hireInfo.setHasGotCoupon("1");
		}else{
			hireInfo.setHasGotCoupon("0");
		}
		
		return hireInfo;
	}

}
